home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / programm.ing / ams__l~1.zoo / man / oscillat.man < prev    next >
Encoding:
Text File  |  1993-09-05  |  1.8 KB  |  80 lines

  1.                         ATARI MACHINE SPECIFIC LIBRARY
  2.  
  3.  
  4.  
  5. NAME
  6.      Oscillator - cyclic value objects
  7.  
  8. SYNOPSIS
  9.      #include <Oscillator.h>
  10.  
  11.      class Oscillator 
  12.      class Cycle
  13.  
  14. DESCRIPTION
  15.      Many games contain elements (graphical or otherwise) that cycle
  16.      or oscillate at a regular rate.  This module provides simple
  17.      classes for such objects.
  18.  
  19. CLASSES
  20.      class Oscillator embodies the concept of a value that goes up then
  21.      down cyclically.
  22.  
  23.      class Cycle embodies the concept of a value that pulses after at
  24.      a certain rate.
  25.  
  26. CLASS MEMBERS
  27.   Oscillator::
  28.      Oscillator(int min,int max)
  29.        A value that cycles to and from min and max.  Initially from min.
  30.  
  31.      operator int()
  32.        The value.
  33.  
  34.      int Oscillate()
  35.        Advance oscillation.
  36.  
  37.   Cycle::
  38.      Cycle()
  39.        A value that pulses every second access to operator()().
  40.  
  41.      Cycle(int n)
  42.        A value that pulses every n accesses to operator()().
  43.  
  44.      bool operator()()
  45.        Advances cycle and returns TRUE iff at the top of the cycle.
  46.  
  47.      void Rate(int R)
  48.        Change the rate of the cycle.
  49.  
  50. EXAMPLES
  51.      Oscillator Bounce(0,10);
  52.  
  53.      while (...) {
  54.          s.MoveTo(x,Bounce);
  55.          Bounce.Oscillate();
  56.      }
  57.  
  58.      Cycle Pulse(4);
  59.  
  60.      while (...) {
  61.          if (Pulse) {
  62.              // Do every 4 times through loop
  63.          }
  64.      }
  65.  
  66. AUTHOR
  67.      Warwick Allison, 1992.
  68.      warwick@cs.uq.oz.au
  69.  
  70. COPYING
  71.      This functionality is part of the Atari Machine Specific Library,
  72.      and is Copyright 1992 by Warwick W. Allison.
  73.  
  74.      The Atari Machine Specific Library is free and protected under the
  75.      GNU Library General Public License.
  76.  
  77.      You are free to copy and modify these sources, provided you acknowledge
  78.      the origin by retaining this notice, and adhere to the conditions
  79.      described in the GNU LGPL.
  80.